using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vt_glMap : EntityTypeConfiguration<vt_gl>
    {
        public vt_glMap()
        {
            // Primary Key
            this.HasKey(t => new { t.GL_ID, t.DATE, t.PERIOD, t.ACCT, t.REC, t.CURREC, t.CURRENCY, t.PDDET, t.PDTTL, t.MODPDHIST, t.MAINSOURCE, t.CSTCTRID });

            // Properties
            this.Property(t => t.GL_ID)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.ID)
                .HasMaxLength(10);

            this.Property(t => t.INVC)
                .HasMaxLength(8);

            this.Property(t => t.PERIOD)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.BATCH)
                .HasMaxLength(8);

            this.Property(t => t.DESC)
                .HasMaxLength(130);

            this.Property(t => t.ACCT)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.SOURCE)
                .HasMaxLength(2);

            this.Property(t => t.REC)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.CURREC)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.CURRENCY)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.PDDET)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.PDTTL)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.MODPDHIST)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.SUBSOURCE)
                .HasMaxLength(3);

            this.Property(t => t.PVRV)
                .HasMaxLength(6);

            this.Property(t => t.CHECK)
                .HasMaxLength(6);

            this.Property(t => t.INVREF)
                .HasMaxLength(6);

            this.Property(t => t.PAYREF)
                .HasMaxLength(6);

            this.Property(t => t.MAINSOURCE)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.CSTCTRID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.SubDatabase)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("vt_gl");
            this.Property(t => t.GL_ID).HasColumnName("GL_ID");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.INVC).HasColumnName("INVC");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.DEBIT).HasColumnName("DEBIT");
            this.Property(t => t.CREDIT).HasColumnName("CREDIT");
            this.Property(t => t.PERIOD).HasColumnName("PERIOD");
            this.Property(t => t.BATCH).HasColumnName("BATCH");
            this.Property(t => t.DESC).HasColumnName("DESC");
            this.Property(t => t.CLOSING).HasColumnName("CLOSING");
            this.Property(t => t.ACCT).HasColumnName("ACCT");
            this.Property(t => t.SOURCE).HasColumnName("SOURCE");
            this.Property(t => t.REC).HasColumnName("REC");
            this.Property(t => t.CURREC).HasColumnName("CURREC");
            this.Property(t => t.DEBITDOL).HasColumnName("DEBITDOL");
            this.Property(t => t.CREDITDOL).HasColumnName("CREDITDOL");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.DEBITACCT).HasColumnName("DEBITACCT");
            this.Property(t => t.CREDITACCT).HasColumnName("CREDITACCT");
            this.Property(t => t.PDDET).HasColumnName("PDDET");
            this.Property(t => t.PDTTL).HasColumnName("PDTTL");
            this.Property(t => t.REVERSING).HasColumnName("REVERSING");
            this.Property(t => t.MISCCASH).HasColumnName("MISCCASH");
            this.Property(t => t.MODPDHIST).HasColumnName("MODPDHIST");
            this.Property(t => t.SUBSOURCE).HasColumnName("SUBSOURCE");
            this.Property(t => t.PVRV).HasColumnName("PVRV");
            this.Property(t => t.CHECK).HasColumnName("CHECK");
            this.Property(t => t.INVREF).HasColumnName("INVREF");
            this.Property(t => t.PAYREF).HasColumnName("PAYREF");
            this.Property(t => t.PAYERTYPE).HasColumnName("PAYERTYPE");
            this.Property(t => t.MAINSOURCE).HasColumnName("MAINSOURCE");
            this.Property(t => t.CSTCTRID).HasColumnName("CSTCTRID");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.JOBID).HasColumnName("JOBID");
            this.Property(t => t.SubDatabase).HasColumnName("SubDatabase");
        }
    }
}
